package kr.pe.johnkim.carrotpoint.mobile.service;

import kr.pe.johnkim.carrotpoint.mobile.dao.CarrotPointMerchantMarketingDao;
import kr.pe.johnkim.carrotpoint.mobile.domain.CarrotPointMerchantMarketing;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Carrot Point 가맹점 마케팅 관련 service 클래스 이다.
 *
 * @author : John_Kim <cale9797@gmail.com>
 * @date : 13. 2. 6.
 */
@Service
public class CarrotPointMerchantMarketingServiceImpl implements CarrotPointMerchantMarketingService {

    // SLF4J Logging
    private Logger logger = LoggerFactory.getLogger(CarrotPointMerchantMarketingServiceImpl.class);

    @Autowired
    private CarrotPointMerchantMarketingDao carrotPointMerchantMarketingDao;

    /**
     * 가맹점 마케팅을 등록 한다.
     *
     * @param carrotPointMerchantMarketing
     */
    @Override
    public void registerMerchantMarketing(CarrotPointMerchantMarketing carrotPointMerchantMarketing) {
        logger.info("registerMerchantMarketing");
        carrotPointMerchantMarketingDao.registerMerchantMarketing(carrotPointMerchantMarketing);
    }

    /**
     * 가맹점 마케팅 목록을 가져 온다.
     *
     * @param carrotPointMerchantMarketing
     * @return
     */
    @Override
    public List<CarrotPointMerchantMarketing> getMerchantMarketingList(CarrotPointMerchantMarketing carrotPointMerchantMarketing) {
        logger.info("getMerchantMarketingList");
        return carrotPointMerchantMarketingDao.getMerchantMarketingList(carrotPointMerchantMarketing);
    }

    /**
     * 가맹점 마케팅 내용을 가져 온다.
     *
     * @param carrotPointMerchantMarketing
     * @return
     */
    @Override
    public CarrotPointMerchantMarketing getMerchantMarketingInformation(CarrotPointMerchantMarketing carrotPointMerchantMarketing) {
        logger.info("getMerchantMarketingInformation");
        return carrotPointMerchantMarketingDao.getMerchantMarketingInformation(carrotPointMerchantMarketing);
    }

    /**
     * 가맹점 마케팅 내용을 수정 한다.
     *
     * @param carrotPointMerchantMarketing
     */
    @Override
    public void updateMerchantMarketingInformation(CarrotPointMerchantMarketing carrotPointMerchantMarketing) {
        logger.info("updateMerchantMarketingInformation");
        carrotPointMerchantMarketingDao.updateMerchantMarketingInformation(carrotPointMerchantMarketing);
    }

    /**
     * 가맹점 마케팅을 비활성화 한다.
     *
     * @param carrotPointMerchantMarketing
     */
    @Override
    public void updateDeactivateMerchantMarketing(CarrotPointMerchantMarketing carrotPointMerchantMarketing) {
        logger.info("updateDeactivateMerchantMarketing");
        carrotPointMerchantMarketingDao.updateDeactivateMerchantMarketing(carrotPointMerchantMarketing);
    }
}
